package com.tiancheng.onecode.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @ClassName LoginTypeEnums
 * @Description TODO
 * @Author kellen
 * @Date 2024/12/7 16:56
 */
@Getter
@AllArgsConstructor
public enum ClientSourceEnums implements BaseEnum<String> {
    wechat_mini("wechat_mini","微信小程序"),
    alipay_mini("alipay_mini","支付宝小程序"),
    union_mini("union_mini","云闪付小程序"),
    ;
    private final String code;
    private final String msg;

    public static Optional<ClientSourceEnums> getByCode(String code){
        return Arrays.stream(ClientSourceEnums.values()).filter(t->t.getCode().equals(code)).findFirst();
    }
}
